Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timing issue in Elasticsearch tests #481

Merged
merged 3 commits into from
Sep 25, 2017

Conversation

takezoe
Copy link
Contributor

@takezoe takezoe commented Sep 19, 2017

Disables parallel test because elasticsearch-cluster-runner which is used to run Elasticsearch for test doesn't support parallel execution on same JVM formally.

Fixes #479.

@@ -39,8 +39,12 @@

@BeforeClass
public static void setup() throws IOException {
System.setProperty("es.set.netty.runtime.available.processors", "false");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this obscure actual problems?

Copy link
Contributor Author

@takezoe takezoe Sep 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm still investigating and testing at my repository. Since this pull request is work in progress, I updated the subject.

For now, we (I and author of elasticsearch-cluster-runner library) think that actual problem is elasticsearch-cluster-runner can't run multiple cluster on same JVM at same time by internal structure of Elasticsearch. Maybe it can be resolved by merging Java test and Scala test.

@takezoe takezoe changed the title Fix timing issue in Elasticsearch tests [WIP] Fix timing issue in Elasticsearch tests Sep 20, 2017
because elasticsearch-cluster-runner doesn't support parallel execution formaly.
@takezoe takezoe force-pushed the fix-elasticsearch-test branch from 45d76e0 to 20839e9 Compare September 20, 2017 16:24
Because elasticsearch tests are executed serially.
@takezoe takezoe force-pushed the fix-elasticsearch-test branch from 0195dbd to cf9084f Compare September 20, 2017 17:18
@takezoe takezoe changed the title [WIP] Fix timing issue in Elasticsearch tests Fix timing issue in Elasticsearch tests Sep 20, 2017
@takezoe
Copy link
Contributor Author

takezoe commented Sep 20, 2017

@raboof This pull request disables parallel execution in elasticsearch project because elasticsearch-cluster-runner doesn't support parallel execution on same JVM formally. It might not be the best solution, but we couldn't find better one.

Copy link
Contributor

@raboof raboof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 small comments for your consideration, but LGTM, so let me know and we can merge!

build.sbt Outdated
@@ -93,6 +93,7 @@ lazy val elasticsearch = project
.enablePlugins(AutomateHeaderPlugin)
.settings(
name := "akka-stream-alpakka-elasticsearch",
parallelExecution in ThisBuild := false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment explaining why this was needed?

Copy link
Contributor Author

@takezoe takezoe Sep 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I fixed to disable only test execution and added a comment.

runner.ensureYellow();

//#init-client
client = RestClient.builder(new HttpHost("localhost", 9211)).build();
client = RestClient.builder(new HttpHost("localhost", 9201)).build();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When (intentionally) re-using the same port, you could consider putting the actual port number in a constant somewhere and referring to it from both places where you use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think sharing the port number is not necessary. These tests are independent and they don't have to use same port necessarily. It's just no longer necessary to use different ports.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, using a constant make it more obvious that it's intentional though. But OK like this 👍

@takezoe
Copy link
Contributor Author

takezoe commented Sep 25, 2017

@raboof Fixed.

@raboof raboof merged commit 42f1f32 into akka:master Sep 25, 2017
@raboof
Copy link
Contributor

raboof commented Sep 25, 2017

Thanks!

@takezoe takezoe deleted the fix-elasticsearch-test branch October 26, 2017 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants